<template>
  <div>
    <div class="container ny_content">
      <div class="ny_nav">
        <div class="ny_nav_h">
          <div>
            <h2>服务质量测评</h2>
            <p>SERVICE QUALITY EVALUATION</p>
          </div>
        </div>
        <div class="ny_nav_dqwz">
          当前位置：<span class="hidden-xs">服务项目></span>服务质量测评
        </div>
      </div>
      <div class="ny_view">
        <div class="ny_news_nav" id="ny_fwxm_fwzl">
          <a href="javascript:void(0)" v-for="(item,index) in evalTypeList" :key="index"
             :class="index == queryInfo.currentValue ? 'news_btn news_on ' : 'news_btn' "
             @click="handleChange(index)">{{ item }}</a>
        </div>
        <div id="fwzl_nr">
          <div class="row fwxm_item" v-for="(c_item,c_index) in evalList" :key="c_index">
            <div class="col-md-9 col-sm-12">
              <div v-html="c_item.content"></div>
            </div>
            <div class="col-md-3 hidden-xs hidden-sm">
              <img :src="c_item.url.url" style="margin-top: -30px;">
            </div>

            <div class="ny_gsjj">
              <h2>服务案例</h2>
              <div id="fwzl_al_content">
                <div id="myCarousel_fwzl" class="carousel slide">
                  <div class="carousel-inner">
                    <div class="item active">
                      <div class="fwzl_al">
                        <div :class="isClass" v-for="(case_item,case_index) in c_item.moreNotifyObject" :key="case_index">
                          <h3>{{case_item.title}}</h3>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'index',
  data () {
    return {
      evalTypeList: [],
      queryInfo: {
        limit: 10,
        page: 1,
        currentValue: 1,
      },
      evalList:[],
      isClass:'fwzl_al_cell',
    }
  },
  created () {
    this.getEvalTypeList()
    this.handleChange(this.queryInfo.currentValue)
  },
  methods: {
    async getEvalTypeList () {
      const {data: res} = await this.$http.get('home/evaluation_type_list')
      if (res.code !== 200) return false
      this.evalTypeList = res.data.list
    },
    async handleChange (index) {
      this.queryInfo.currentValue = index
      this.isClass = this.queryInfo.currentValue == 1 ? 'fwzl_al_cell' : 'fwzl_al_cell fwzl_myd_al_cell'
      const {data: res} = await this.$http.get('home/evaluation_list', {params: this.queryInfo})
      if (res.code !== 200) return false
      this.evalList = res.data.list
    }
  }
}
</script>

<style scoped>

</style>
